import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		name: 'login',
		component: () => import("@/views/login/Login")
	},
	{
		path: '/home',
		name: 'home',
		redirect: '/data',
		component: () => import("@/views/home/Home"),
		// 自路由 在home页面里显示东西
		children: [
			{
				path: '/member',
				name: 'member',
				component: () => import("@/views/member/Member")
			},
			{
				path: '/classify',
				name: 'classify',
				component: () => import("@/views/classify/Classify")
			},
			{
				path: '/product',
				name: 'product',
				component: () => import("@/views/product/Product")
			},
			{
				path: '/order',
				name: 'order',
				component: () => import("@/views/order/Order")
			},
			{
				path: '/data',
				name: 'data',
				component: () => import("@/views/data/Data")
			},
			{
				path: '/sx',
				name: 'sx',
				component: () => import("@/views/sx/Sx")
			},]
	},
	{
		path: '/lg',
		name: 'lg',
		component: () => import("@/views/lg/Lg")
	}

]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
